<template>
  <div class="videoinfo-container" ref='videoinfo_container'>
    <h3 class="title">
      {{ item.title }}
      <span class="zuobiao">{{ item.loc_name }}</span>
    </h3>
    <div class="img_large">
      <img :src="item.image" alt="">
    </div>
    <p>
      <span class="time">时间:</span>
      <span>
        {{ item.begin_time}}
        <br>
        {{ item.end_time}}
      </span>
    </p>
    <p class="address">
      地点:
      <span class="address-name">{{ item.address }}</span>
    </p>
    <p class="price">
      费用:
      <span>{{ item.fee_str }}</span>
    </p>
    <p class="type">
      类型:
      <span>{{ item.category_name }}</span>
    </p>
    <p class="starttime">
      起始时间:
      <span>{{ item.time_str }}</span>
    </p>
    <div class="tags-list" v-if="((item.tags).trim().split(',').length)">
      <span  v-if="item.tags.trim().length === 0? false: true" v-for="(tag , index) in (item.tags).trim().split(',')" :key="index">{{ tag }}</span>
    </div>
    <div class="info">
      <h4>活动详情</h4>
      <div class="content" v-html='item.content'></div>
    </div>
    <div class="download">
      <div class="top">
        <img
          src=""
          alt=""
        >
        <div class="appword">
          <p class="douban">豆瓣</p>
          <p class="words">我们的精神角落</p>
        </div>
      </div>
      <div class="bottom">
        <a href="https://apps.apple.com/cn/app/%E8%B1%86%E7%93%A3/id907002334">去 App Store 免费下载 iOS 客户端</a>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      infos: JSON.parse(sessionStorage.getItem("videodetailinfos") || "[]"),
      item: {},
      id: this.$route.params.id
    };
  },
  methods: {
    getInfositem() {
     
      this.infos.some(item => {
        if (item.id === this.id) {
          this.item = item;
          console.log(item.tags)
          return true;
        }
      });
    }
  },
  created() {
    this.getInfositem();
  },
  mounted(){
  }
};
</script>

<style lang="less" scoped>
.videoinfo-container {
  background: #fff;
  padding: 10px;
  .title {
    font-size: 1.2rem;
    text-align: center;
    margin: 15px 0;
    span {
      padding: 3px;
      border-radius: 5px;
      font-size: 0.4rem;
      background-color: rgba(255, 0, 0, 0.5);
    }
  }
  .img_large {
    text-align: center;
    margin-bottom: 15px;
    img {
      width: 12rem;
    }
  }
  .tags-list {
    margin-bottom: 20px;
    span {
      padding: 7px;
      background: rgba(200, 200, 200, 0.3);
      margin: 0 0.8rem;
      font-size: 1rem;
      border-radius: 12px;
      color: #666;
    }
  }
  .info {
    margin-bottom: 20px;
    h4 {
      font-size: 1.1rem;
      margin-bottom: 15px;
      color: #06c713;
    }
    .content {
      color: #666;
      font-size: 0.8rem;
    }
  }
  .download {
    text-align: center;
    .top {
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 5px;
      img {
        width: 4rem;
      }
      p {
        margin: 0;
        padding: 0;
        text-align: left;
        margin-left: 10px;
        color: #333;
        font-size: 1rem;
        &.douban {
          font-size: 1.8rem;
          margin-bottom: 0.3rem;
        }
      }
    }
  }
  .bottom {
    font-size: 1rem;
  }
}
</style>